<template>
  <div>
    {{ data }}
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import axios from 'axios'

const data = ref([])

const getData = async () => {
  const res = await axios.get('http://localhost:3000/users')
  console.log(res.data)
  data.value = res.data
}

// 网络请求
onMounted(() => {
  getData()
})
</script>

<style lang="scss" scoped></style>
